<template>
        <el-dialog :close-on-click-modal = "clickClose" :visible.sync="visible" :title="title">
            <slot></slot>
                <div slot="footer" class="dialog-footer">
                    <slot name="footer">
                        <el-button @click="visible = false">取 消</el-button>
                        <el-button type="primary" :loading="loading" @click="$emit('confirm')">确 定</el-button>
                    </slot>
                </div>
        </el-dialog>
</template>
<script>
export default {
    name:"Dialog",
    props:{
        /**
         * 点击遮罩层关闭
         */
        clickClose:Boolean,
        /**
         * 标题
         */
        title:String,
    },
    data() {
        return {
            /**
             * 显示隐藏
             */
            visible:false,
            /**
             * loading
             */
            loading:false,
        }
    },
    methods: {
        /**
         * 开始loading
         */
        start(){
            this.loading = true;
        },
        /**
         * 停止loading
         */
        stop(){
            this.loading = false;
        },
        /** 
         *显示 
        */
        show(){
            this.visible = true;
        },
          /** 
         *隐藏 
        */
        hide(){
            this.visible = false;
        }
    },
}
</script>
<style lang="less">
    
</style>